<!DOCTYPE html>
<uieip type="page" value="login" debug="true" timeout="5000"></uieip>
<uieip type="reg" value="console"></uieip>

<html>
<head>
    <uieip type="file" value="inc" src="/yqwin/easyui/include.txt" cache="true" minute="1440"></uieip>
    <uieip type="file" value="css" src="/yqwin/css/yqwin.min" cache="true"></uieip>
    <uieip type="file" value="js" src="/yqwin/src/yqwin.min" cache="true"></uieip>
    <title>tree edit</title>
<body style="margin: 0px;">
    <table id="tb_post">             
    </table>
    <script>
        var dbname="yqbase";
        
        function form_load(){
            $(window).resize(function(){
                onresize();
            });
            onresize();
             $("#tb_post").yqDataGrid("loadData");
        }

        function onresize(){
            $("#tb_post").yqDataGrid('resize', {
                width:$(window).width(),
                height:$(window).height()
            });
        }
 
        $(function () {
            $.yqDbList({ajaxUrl: "_db.html"}, 
                function (data) {     
                    if (data.error == 0) {
                        dbname=data.rows[0].name;
                        //console.log(data,dbname);
                        init_post();
                    }else{
                        alert(data.info);
                    }
                });
        });

        function init_post(){
            $("#tb_post").yqDataGrid({
                ajaxUrl: "/_db.html",
                dbname: dbname,
                tbname: "hr_post",
                keyId: "sid",
                bindingKeyId: null,
                bindingValue: null,
                
                addWhere: "",
                order: "code",

                frozenNum: 2,
                editMode: 3, 
                editModeW: 600,
                editModeH: 450,
                editModeNo: 1,
                loadData: false,
                isPage: true,

                isEdit: true,
                copy: true,
                add: true,
                upp: true,
                del: true,
                isdel: true,
                isdelEdit: true,
                move: false,

                linkField: ["name"],

                beforeBindingTitle: function (columns, callback) {
                    callback(columns);
                }, //标题绑定前
                afterBindingTitle: function () {          
                    form_load();
                }, //标题绑定后
            });
        }
    </script>
</body>
</html>